package com.generic.rangewildcard.extend;

import java.util.Arrays;
import java.util.List;

import com.generic.rangewildcard.Apple;
import com.generic.rangewildcard.Fruit;

public class GenericsAndCovariance2 {

	public static void main(String[] args) {
		// 通配符?：具有任何从Fruit继承的类型的列表
		List<? extends Fruit> flist = Arrays.asList(new Apple());
		Apple a = (Apple) flist.get(0);
		flist.contains(new Apple());
		flist.indexOf(new Apple());
	}

}
